package com.beidasoft.web.util.enums;

public enum SimpleCardTypeEnum {

    CARD_TYPE_01("01", 1, "居民身份证"),
    CARD_TYPE_02("02", 2, "驾驶证"),
    CARD_TYPE_03("03", 4, "护照"),
    CARD_TYPE_04("04", 6, "港澳居民来往内地通行证"),
    CARD_TYPE_05("05", 8, "台湾居民来往大陆通行证"),
    CARD_TYPE_06("06", 3, "军官证"),
    CARD_TYPE_07("07", 7, "士兵证"),
    CARD_TYPE_99("99", 5, "其他");

    private String code;//检查代码值
    private Integer type;//处罚代码值
    private String name;

    public String getCode() {
        return code;
    }

    public Integer getType() {
        return type;
    }

    public String getName() {
        return name;
    }

    SimpleCardTypeEnum(String code, Integer type, String name) {
        this.code = code;
        this.type = type;
        this.name = name;
    }

    /**
     * @return java.lang.Integer
     * @Author songff
     * @MethodName getTypeByCode
     * @Description //TODO 通过检查的证件类型代码值，获取处罚的证件类型代码值
     * @Date 21:26 2020/3/26
     * @Param [code]
     **/
    public static Integer getTypeByCode(String code) {
        switch (code) {
            case "01":
                return CARD_TYPE_01.type;
            case "02":
                return CARD_TYPE_02.type;
            case "03":
                return CARD_TYPE_03.type;
            case "04":
                return CARD_TYPE_04.type;
            case "05":
                return CARD_TYPE_05.type;
            case "06":
                return CARD_TYPE_06.type;
            case "07":
                return CARD_TYPE_07.type;
            case "99":
                return CARD_TYPE_99.type;
            default:
                return null;
        }
    }

    /**
     * @return java.lang.String
     * @Author songff
     * @MethodName getCodeByType
     * @Description //TODO 通过处罚的证件类型代码值，或者检查的代码值
     * @Date 21:27 2020/3/26
     * @Param [type]
     **/
    public static String getCodeByType(Integer type) {
        switch (type) {
            case 1:
                return CARD_TYPE_01.code;
            case 2:
                return CARD_TYPE_02.code;
            case 3:
                return CARD_TYPE_06.code;
            case 4:
                return CARD_TYPE_03.code;
            case 5:
                return CARD_TYPE_99.code;
            case 6:
                return CARD_TYPE_04.code;
            case 7:
                return CARD_TYPE_07.code;
            case 8:
                return CARD_TYPE_05.code;
            default:
                return null;
        }
    }

    /**
     * @return java.lang.String
     * @Author songff
     * @MethodName getNameByTypeOrCode
     * @Description //TODO  通过检查的证件类型代码值，获取证件类型中文代码值
     * @Date 11:56 2020/3/27
     * @Param [type]
     **/
    public static String getNameByCode(String code) {
        switch (code) {
            case "01":
                return CARD_TYPE_01.name;
            case "02":
                return CARD_TYPE_02.name;
            case "03":
                return CARD_TYPE_03.name;
            case "04":
                return CARD_TYPE_04.name;
            case "05":
                return CARD_TYPE_05.name;
            case "06":
                return CARD_TYPE_06.name;
            case "07":
                return CARD_TYPE_07.name;
            case "99":
                return CARD_TYPE_99.name;
            default:
                return null;
        }
    }

}
